<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


<%@ page contentType="text/html; charset=UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <title>信息统计</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/bootstrap-responsive.css"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/style.css"/>
    <link href="<%=request.getContextPath()%>/Css/jquery-ui.min.css"
          type="text/css" rel="stylesheet"/>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery2.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery2.sorted.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/ckform.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/common.js"></script>
    <script type="text/javascript"
            src="<%=request.getContextPath()%>/js/jquery-ui.min.js"></script>
    <script
            src="<%=request.getContextPath()%>/js/My97DatePicker/WdatePicker.js"></script>
    <style type="text/css">
        table {
            table-layout: fixed; /* 只有定义了表格的布局算法为fixed，下面td的定义才能起作用。 */
        }

        table td {
            width: 100%;
            word-break: keep-all; /* 不换行 */
            white-space: nowrap; /* 不换行 */
            overflow: hidden; /* 内容超出宽度时隐藏超出部分的内容 */
            text-overflow: ellipsis;
            /* 当对象内文本溢出时显示省略标记(...) ；需与overflow:hidden;一起使用*/
        }

    </style>
</head>
<body>
<form id="queryOrderForm" class="form-inline definewidth m20" action="/" method="post">

    <p>
    <label> <span>代理商ID: </span>
        <input type="text" name="agentId" id="agentId" class="abc input-default"
        value="${agentId}">&nbsp;&nbsp;
    </label>
    <label> <span>订单来源: </span>
        <select name="sourceType" id="sourceType" class="abc input-default">
            <option value="-1"<c:if test="${paramMap.sourceType==-1}">selected="selected"</c:if>>-----全部来源-----</option>
            <option value="1"<c:if test="${paramMap.sourceType==1}">selected="selected"</c:if>>平台充值</option>
            <option value="0"<c:if test="${paramMap.sourceType==0}">selected="selected"</c:if>>手机充值</option>

        </select>
    </label></p>
    <p>
    <label> <span>时间区间:
        </span><input class="text-input small-input" type="text" id="begintime"
                      name="begintime" value="${paramMap.begintime}"  onclick="WdatePicker({startDate:'%y-%M-%d'})"
                      onFocus="WdatePicker({startDate:'%y-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'endtime\')}',minDate:'#F{$dp.$D(\'endtime\',{d:-32})}',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})"
                      readonly="readonly" />~~~

        <input class="text-input small-input"
               type="text" id="endtime" name="endtime" value="${paramMap.endtime}" onclick="WdatePicker({startDate:'%y-%M-{%d+1}'})"
               onFocus="WdatePicker({startDate:'%y-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'begintime\',{d:+32})}',minDate:'#F{$dp.$D(\'begintime\')}',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})"
               readonly="readonly" />
    </label>
    <button type="button" class="btn btn-primary" onclick="queryOrderInfo();">查询</button></p>
</form>
<div>
<table id="orderTable" class="table table-bordered table-hover definewidth m10">

    <thead>
    <tr>
        <th width="10%">序号</th>
        <th width="20%">玩家ID</th>
        <th width="10%">消费金额</th>
        <th width="10%">钻石数量</th>
        <th width="10%">订单状态</th>
        <th width="20%">订单时间</th>
        <th width="20%">代理商ID</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${page.data}" var="orderInfo" varStatus="dataStatus">


        <tr>
            <td>${dataStatus.index+1}</td>
            <td title="${orderInfo.playerId}">${orderInfo.playerId}</td>
            <td title="${orderInfo.money}">${orderInfo.money}</td>
            <td title="${orderInfo.coin}">${orderInfo.coin}</td>
            <td >
            <c:if test="${orderInfo.orderStatus==0}">
                未支付
            </c:if>
            <c:if test="${orderInfo.orderStatus==1}">
                支付成功
            </c:if>
            </td>
            <td>${fn:substring(orderInfo.orderTime,0,19)}</td>
            <td title="${orderInfo.agentId}">${orderInfo.agentId}</td>
        </tr>
    </c:forEach>
    </tbody>
    <tfoot>
    <tr bgcolor="EEF7FE">
        <td colspan="14" bgcolor="EEF7FE" class="f">
            <div align="right" style="bgcolor:EEF7FE" class="f">
                <jsp:include page="/common/pageUtil.jsp"></jsp:include>
            </div>
        </td>
    </tr>
    </tfoot>
</table>
</div>
</body>
<script type="text/javascript">


    function queryOrderInfo(){
        if($("#begintime").val()==''||$("#endtime").val()==''){
            alert("请选择开始或者结束时间");
            return ;
        }

        var form = document.getElementById("queryOrderForm");
        form.action = "<%=request.getContextPath()%>/order/queryOrder.html";
        form.submit();
    }


    // 下一页
    function getNextPage(page) {
        var form = document.getElementById("queryOrderForm");
        form.action = "<%=request.getContextPath()%>/order/queryOrder.html?pageIndex="+page;
        form.submit();
    }

</script>
</html>